﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormProject.Kasa
{
    public partial class KasaEkrani : Form
    {
        public KasaEkrani()
        {
            InitializeComponent();
        }

        private void KasaEkrani_Load(object sender, EventArgs e)
        {

        }
        DBBaglantiDataContext db = new DBBaglantiDataContext();
        private void btnMusteriBul_Click(object sender, EventArgs e)
        {
            var sorgu = from x in db.Musteri_Bilgileris where (string)x.MusteriVergiNo == txtMusteriTCKimlik.Text select new { x.MusteriAdi, x.MusteriSoyadi, x.MusteriVergiNo, x.MusteriVergiDairesi, x.MusteriTelefon01, x.MusteriPuan, x.MusteriTipi, x.MusteriOzelIndirimOrani, x.MusteriIletisimAdresi };


            foreach (var item in sorgu)
            {
                lblMusteriAdi.Text = item.MusteriAdi.ToString();
                lblMusteriSoyadi.Text = item.MusteriSoyadi.ToString();
                lblMusteriVergiNo.Text = item.MusteriVergiNo.ToString();
                lblMusteriVergiDairesi.Text = item.MusteriVergiDairesi.ToString();
                lblMusteriTelefon.Text = item.MusteriTelefon01.ToString();
                lblMusteriPuani.Text = item.MusteriPuan.ToString();
                lblMusteriTipi.Text = item.MusteriTipi.ToString();
                lblIndirimOrani.Text = item.MusteriOzelIndirimOrani.ToString();
                label3.Text = item.MusteriIletisimAdresi.ToString();
            }
        }

        private void müsteriEkleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form frm = new MusteriKayıtFormu();
            frm.Show();
            this.Hide();

            

        }

    
    }
}
